import request from '@/utils/request'


// 获取客户投诉主表列表
export function qmsbusicustomercomplaint(query)
{
    return request({
        url: `/api/Business/qmsbusicustomercomplaint`,
        method: 'GET',
        data: query
    });
}

//获取客户投诉
export function qmsbusicustomercomplaintByid(id)
{
    return request({
        url: `/api/Business/qmsbusicustomercomplaint/${id}`,
        method: 'GET',
    });
}
//更新客诉
export function updateQmsbusicustomercomplaint(data)
{
    return request({
        url: `/api/Business/qmsbusicustomercomplaint/${data.id}`,
        method: 'PUT',
        data
    });
}

//删除客诉
export function deletetQmsbusicustomercomplaint(id)
{
    return request({
        url: `/api/Business/qmsbusicustomercomplaint/${id}`,
        method: 'DELETE',
    });
}

//新建客诉
export function insertQmsbusicustomercomplaint(data)
{
    return request({
        url: `/api/Business/qmsbusicustomercomplaint`,
        method: 'POST',
        data
    });
}

//导出客诉
export function Export(data)
{
    return request({
        url: `/api/Business/qmsbusicustomercomplaint/Actions/Export`,
        method: 'GET',
        data
    });
}

// 批量关闭
export function CloseWorkOrder(ids) {
    return request({
        url: `/api/Business/qmsbusicustomercomplaint/CloseWorkOrder`,
        method: 'POST',
        data:ids
    })
}

//批量删除
export function batchRemove(ids) {
    return request({
        url: `/api/Business/qmsbusicustomercomplaint/batchRemove`,
        method: 'POST',
        data:ids
    })
}
//新建纠错和预防措施
export function qmsbusicustomermeasure(data)
{
    return request({
        url: `/api/Business/qmsbusicustomermeasure`,
        method: 'POST',
        data
    });
}

//新建现场调查表
export function qmsbusicustomersurvey(data)
{
    return request({
        url: `/api/Business/qmsbusicustomersurvey`,
        method: 'POST',
        data
    });
}

//新建质量申诉
export function qmsbusicustomerappeal(data)
{
    return request({
        url: `/api/Business/qmsbusicustomerappeal`,
        method: 'POST',
        data
    });
}

//新建客诉文件
export function qmsbusicustomerfile(data)
{
    return request({
        url: `/api/Business/qmsbusicustomerfile`,
        method: 'POST',
        data
    });
}

//修改客诉文件
export function updateqmsbusicustomerfile(data)
{
    return request({
        url: `/api/Business/qmsbusicustomerfile/${data.id}`,
        method: 'PUT',
        data
    });
}

//获取客诉文件
export function getqmsbusicustomerfile(id)
{
    return request({
        url: `/api/Business/qmsbusicustomerfile/${id}`,
        method: 'get',
      
    });
}

//删除客诉文件
export function deleteqmsbusicustomerfile(id)
{
    return request({
        url: `/api/Business/qmsbusicustomerfile/${id}`,
        method: 'DELETE',
   
    });
}

//质量申诉打印
export function PrintCustpmerAppeal(form)
{
    return request({
        url: `/api/Business/qmsbusicustomerappeal/fastreportPrintCustpmerAppeal?exportType=${form.exportType}`,
        method: 'POST',
        responseType: "arraybuffer",
        data: form.list
    });
}
//纠错和预防打印
export function PrintCustomerMeasure(form)
{
    return request({
        url: `/api/Business/qmsbusicustomermeasure/fastreportPrintCustomerMeasure?exportType=${form.exportType}`,
        method: 'POST',
        responseType: "arraybuffer",
        data: form.list
    });
}
//现场调查打印
export function PrintCustomerSurvey(form)
{
    return request({
        url: `/api/Business/qmsbusicustomersurvey/fastreportPrintCustomerSurvey?exportType=${form.exportType}`,
        method: 'POST',
        responseType: "arraybuffer",
        data: form.list
    });
}

//获取质量申诉
export function getqmsbusicustomerappeal(id)
{
    return request({
        url: `/api/Business/qmsbusicustomerappeal/info/${id}`,
        method: 'GET',
    });
}

//获取纠错和预防措施
export function getqmsbusicustomermeasure(id)
{
    return request({
        url: `/api/Business/qmsbusicustomermeasure/${id}`,
        method: 'GET',
    });
}

//获取现场调查表
export function getqmsbusicustomersurvey(id)
{
    return request({
        url: `/api/Business/qmsbusicustomersurvey/${id}`,
        method: 'GET',
    });
}

//修改质量申诉
export function updateqmsbusicustomerappeal(data)
{
    return request({
        url: `/api/Business/qmsbusicustomerappeal/${data.id}`,
        method: 'PUT',
        data
    });
}
//修改纠错和预防
export function updateqmsbusicustomermeasure(data)
{
    return request({
        url: `/api/Business/qmsbusicustomermeasure/${data.id}`,
        method: 'PUT',
        data
    });
}

//修改现场调查
export function updateqmsbusicustomersurvey(data)
{
    return request({
        url: `/api/Business/qmsbusicustomersurvey/${data.id}`,
        method: 'PUT',
        data
    });
}

//生成单号
export function CreateWorkerCode()
{
    return request({
        url: `/api/Business/qmsbusicustomercomplaint/CreateWorkerCode`,
        method: 'POST',
    });
}

export default {
    qmsbusicustomercomplaint,
    qmsbusicustomercomplaintByid,
    updateQmsbusicustomercomplaint,
    deletetQmsbusicustomercomplaint,
    insertQmsbusicustomercomplaint,
    Export,
    CloseWorkOrder,
    qmsbusicustomermeasure,
    qmsbusicustomersurvey,
    qmsbusicustomerappeal,
    batchRemove,
    qmsbusicustomerfile,
    getqmsbusicustomerfile,
    deleteqmsbusicustomerfile,
    updateqmsbusicustomerfile,
    PrintCustpmerAppeal,
    PrintCustomerMeasure,
    PrintCustomerSurvey,
    getqmsbusicustomerappeal,
    getqmsbusicustomermeasure,
    getqmsbusicustomersurvey,
    updateqmsbusicustomerappeal,
    updateqmsbusicustomermeasure,
    updateqmsbusicustomersurvey,
    CreateWorkerCode
    



};
